"""
二进制方式打开
"""
# 1.1 所有内容读取
file_path = "/day03/test.txt"
file_obj = open(file_path, 'rb')

while True:
    data = file_obj.read()
    if not data:
        break
    print(data, end="")

file_obj.close()

# 1.2 按字节读取
file_path = "/day03/test.txt"
file_obj = open(file_path, 'rb')

while True:
    data = file_obj.read(1)
    if not data:
        break
    print(data, end="")

file_obj.close()
